/* This file wraps ECalComponent class */

%module "evolution"
%{
#include <libecal/e-cal-component.h>	
%}

struct ECalComponent
{
};



%extend ECalComponent
{
        ECalComponent () {
            //The default initializer will not initilize the icalcomp structure of ECalComponent 
            //rendering the object useless so we initialize it as an empty event
            return e_cal_component_new_from_string("BEGIN:VEVENT\nEND:VEVENT");
		}
		ECalComponent* dup() {
			e_cal_component_commit_sequence(self);
			return e_cal_component_clone(self);
		}
        ECalComponent (const char* str) {
            return e_cal_component_new_from_string(str);
		}

        ECalComponent (ECalComponent* e) {
            return e_cal_component_clone(e);
		}

        const char* __str__()
        {
            e_cal_component_commit_sequence(self);
            return e_cal_component_get_as_string(self);
        }
		bool __eq__(ECalComponent* comp)
		{
			const char *uid1,*uid2;
			e_cal_component_commit_sequence(self);
			e_cal_component_commit_sequence(comp);
			e_cal_component_get_uid(self,&uid1);
			e_cal_component_get_uid(comp,&uid2);
			return strcmp(uid1,uid2)==0;
		}
};

DEFINE_DEFAULT_DESTRUCTOR(ECalComponent)
PROPERTY_EDS_ALLOC_RW(ECalComponent, uid, const char*, e_cal_component_get_uid, e_cal_component_set_uid )
PROPERTY_EDS_ALLOC_RW(ECalComponent, url, const char*, e_cal_component_get_url, e_cal_component_set_url )
PROPERTY_EDS_ALLOC_RW(ECalComponent, location, const char*, e_cal_component_get_location, e_cal_component_set_location )
PROPERTY_EDS_ALLOC_RW(ECalComponent, categories, const char*, e_cal_component_get_categories, e_cal_component_set_categories )
PROPERTY_EDS_ALLOC_RW(ECalComponent, descriptions, ECalComponentTextList, e_cal_component_get_description_list, e_cal_component_set_description_list )
PROPERTY_EDS_ALLOC_RW(ECalComponent, comments, ECalComponentTextList, e_cal_component_get_comment_list, e_cal_component_set_comment_list )
PROPERTY_EDS_ALLOC_RW(ECalComponent, contacts, ECalComponentTextList, e_cal_component_get_contact_list, e_cal_component_set_contact_list )
PROPERTY_EDS_ALLOC_RW(ECalComponent, created, icaltimetype*, e_cal_component_get_created, e_cal_component_set_created )
PROPERTY_EDS_ALLOC_RW(ECalComponent, completed, icaltimetype*, e_cal_component_get_completed, e_cal_component_set_completed )


PTR_PROPERTY_RW(ECalComponent, summary, ECalComponentText, e_cal_component_get_summary, e_cal_component_set_summary )
PTR_PROPERTY_RW(ECalComponent, dtend, ECalComponentDateTime, e_cal_component_get_dtend, e_cal_component_set_dtend )
PTR_PROPERTY_RW(ECalComponent, dtstart, ECalComponentDateTime, e_cal_component_get_dtstart, e_cal_component_set_dtstart )
PTR_PROPERTY_RW(ECalComponent, due, ECalComponentDateTime, e_cal_component_get_due, e_cal_component_set_due )
PTR_PROPERTY_RW(ECalComponent, dtstamp, icaltimetype, e_cal_component_get_dtstamp, e_cal_component_set_dtstamp )


